package de.koller.million.render.obj;

import de.koller.million.render.RenderRoot;
import de.koller.oceanFramework.gl.util.Light;
import de.koller.oceanFramework.tree.Mother;
import de.koller.oceanFramework.tree.Sea3X;

public class LightRender extends Sea3X {

	@Mother private RenderRoot rroot;
	private final Light light = new Light();

	@Override
	protected void init() {
		super.init();
		
		light.setLightGL(	-1f, .8f, .5f, 0,  
							0.6f, 0.6f, 0.6f, 1, 
							.3f, .3f, .3f, 1, 
							0, 0, 0, 1 );
	}

	@Override
	protected void render( int elapsedTime ) {
		super.render( elapsedTime );

		light.disableLightGL();
		
		if( rroot.getRenderIteration() == 2 || rroot.getRenderIteration() == 0 )
			light.setLightGL();
	}
	
}
